﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Example07_CSharp
{
    class CPolygon
    {
        protected int width, height;
        public void setValues(int a, int b)
        {
            width = a;
            height = b;
        }
    }
        
    class CRectangle:CPolygon
        {
            public int area()
            {
                return (width * height);
            }
        }
      class CTriangle : CPolygon
        {
            public int area()
            {
                return (width * height / 2);
            }
        }
    
    class Program
    {
        static void Main(string[] args)
        {
            CRectangle rect = new CRectangle();
            CTriangle trgl = new CTriangle();
            rect.setValues(4, 5);
            trgl.setValues(4, 5);
            Console.WriteLine("recta:{0}", rect.area());
            Console.WriteLine("rectb:{0}", rect.area());
            
           
        }

    }
}
